<template>
    <view class="logOff">
        <Navigation backType="back" title="注销账号" background="#fff" />
        <view class="bg">
            <view v-show="curt == 1">
                <view class="pt-20 f jc-c ai-c">
                    <view class="w-48 h-48 b-48 yuan1 f ai-c jc-c"><view class="w-12 h-12 b-12 yuan2"></view></view>
                    <view class="w-260 h-8 heng"></view>
                    <view class="w-36 h-36 b-36 yuan3 f ai-c jc-c fs-24 fw-600 text-color3">2</view>
                </view>
                <view class="f ai-c jc-c mt-16 ph-125">
                    <view class="fs-26 fw-600 text-color4 w-240 f jc-c mr-20">验证身份信息{{curt}}</view>
                    <view class="fs-26 text-color10 w-240 f jc-c">重要提醒</view>
                </view>
            </view>
            <view v-show="curt == 2">
                <view class="pt-20 f jc-c ai-c">
                    <image src="../../static/select-check.png" class="w-32 h-32"></image>
                    <view class="w-260 h-8 heng"></view>
                    <view class="w-48 h-48 b-48 yuan1 f ai-c jc-c"><view class="w-12 h-12 b-12 yuan2"></view></view>
                </view>
                <view class="f ai-c jc-c mt-16 ph-125">
                    <view class="fs-26 text-color3 w-240 f jc-c mr-20">验证身份信息</view>
                    <view class="fs-26 fw-600 text-color4 w-240 f jc-c">重要提醒</view>
                </view>
            </view>

			
            <Identity v-show="curt == 1" @fn="chanCurt"/>
            <Tip v-show="curt == 2"  @cf="submit"/>
        </view>
    </view>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import Tip from './Tip.vue';
import Identity from './Identity.vue';
import { authLogOff } from '@/services/api/auth';
	import { useAuthStore } from '@/store/modules/auth';
	const authStore = useAuthStore();
	const curt = ref(1);
	const mobile = ref('');
	const code = ref('');
	const chanCurt = (ct:number,smscode:string,tel:string) => {
	    curt.value=ct;
	    mobile.value=tel;
	    code.value=smscode;
	}
	const submit = async ()=>{
		await authLogOff({mobile: mobile.value, scene: 1,code:code.value});
		uni.showToast({
		    title: '注销成功',
		    icon: 'none',
		});
		authStore.loginOut();
	}
</script>
<style lang="scss" scoped>
.logOff {
    background: #f5f5f5;
    min-height: 100vh;

    .heng {
        background: #faf4e9;
    }
    .yuan1 {
        background: #fabb3c;
        border: 8rpx solid #faf4e9;
    }
    .yuan2 {
        background: #ffffff;
    }
    .yuan3 {
        background: #f0f0f0;
    }
    .bg {
        background: #fff;
    }
}

.identity {
    .btn1 {
        background: #f5f5f5;
    }
    .btn2 {
        background: #fabb3c;
    }
    .bot {
        position: fixed;
        left: 0;
        bottom: 0;
        background: #fff;
    }
    .su {
        background: #faf4e9;
    }
    .list {
        border-bottom: 1px solid #f5f5f5;
    }
}
</style>
